Test coverage of software is generally measured during the development phase. Test coverage tracks a program's execution and identifies which instructions are executing. This enables developer to optimize code by removing portions of code that never execute. An example of code that never executes is an error handler for a situation which never occurs. The inherent disadvantage to this approach is that code coverage is measured in the development and testing phases, and generally ends once the code goes into production.
In order to test coverage in production software shipped to customers, software is instrumented. Instrumentation adds extra code to the software and traps to the instrumentation code whenever uncovered code (i.e. code not previously accessed) is executed. Implementing instrumentation requires extra development and execution time. In addition, executing software with instrumentation adds additional overhead and exposes the software to additional defects. All existing coverage techniques implementing instrumentation involve some kind of software traps (e.g., breakpoints).
Therefore, there is a need for a code coverage detection mechanism that does not increase overhead or impact performance. The mechanism should provide code coverage analysis at all stages of the development and production cycles. By continually analyzing code coverage at all system installations more comprehensive code coverage can be realized.